package com.qt.controller.oj;

import com.qt.annotation.OpenApi;
import com.qt.mapper.ProblemMapper;
import com.qt.pojo.dto.ProblemQueryDTO;
import com.qt.result.R;
import com.qt.service.oj.ProblemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author pgw
 * @version 1.0
 * @description
 * @date Create by 2023/9/23 19:33
 */
@RestController
@RequestMapping("/problem")
public class ProblemController {

    @Autowired
    private ProblemService problemService;
    @Autowired
    private ProblemMapper problemMapper;

    @GetMapping("/list")
    @OpenApi
    public R  getProblemList(@RequestBody ProblemQueryDTO problemQueryDto){
          problemMapper.selectList(null);

        return problemService.getProblemList(problemQueryDto);

    }


    @GetMapping("/detail")
    @OpenApi
    public  R getProblemDetail(@RequestParam("problemId") Long problemId){

        return problemService.getProblemDetail(problemId);

    }

}
